package com.jlpay.openapi.demo.fund.deferred;

import com.jlpay.open.jlpay.sdk.java.model.BaseResponse;
import com.jlpay.open.jlpay.sdk.java.model.fund.deferred.request.FundRefreezeRequest;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author chenjunhong
 * @since 2024/12/20
 */
public class FundRefreezeService {

    private static final Logger LOGGER = LoggerFactory.getLogger(FundRefreezeService.class);

    public static void main(String[] args) {
        FundRefreezeRequest fundRefreezeRequest = buildFundRefreezeRequest();
        BaseResponse fundRefreezeResponse = JlpayOpenApiService.openMerchService()
                .post(fundRefreezeRequest, BaseResponse.class);
        LOGGER.info("资金续冻响应:{}", JsonUtils.toString(fundRefreezeResponse));
    }

    private static FundRefreezeRequest buildFundRefreezeRequest() {
        FundRefreezeRequest fundRefreezeRequest = new FundRefreezeRequest();
        fundRefreezeRequest.setOutOrderId("test_refreeze_202412200001");
        fundRefreezeRequest.setOriOutOrderId("test_freeze_202412200001");
        fundRefreezeRequest.setMerchNo("849551860110001");
        fundRefreezeRequest.setReason("续冻测试");
        fundRefreezeRequest.setRemark("续冻测试");
        return fundRefreezeRequest;
    }
}
